package com.argticling.dao.impl;

import com.argticling.dao.impl.hibernate.HibernateUtil;
import com.argticling.dao.interf.DAOInterface;
import com.argticling.model.Article;
import com.argticling.model.Persistable;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public abstract class AbstractDAOImplementation implements DAOInterface {

    public void delete(Persistable persistable) {
//        persistable.remove(true, true);//todo rever...
        persist(persistable);
    }

    public void persist(Persistable persistable) {
        HibernateUtil hibernateUtil = new HibernateUtil();
        hibernateUtil.persist(persistable);
    }

    public static void main(String[] args) {
        /*Article article = new Article();
        article.setPublished(true);
        article.setId("TXTXTXTXTXTX");
        ArticleDAOImplementation articleDAOImplementation = new ArticleDAOImplementation();
        articleDAOImplementation.persist(article);*/
    }
}
